package com.bifrost.repository;

import com.bifrost.entity.Customer;
import com.bifrost.entity.MerchantStore;
import com.bifrost.entity.ShoppingCart;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author rangf
 * @date 2017/11/6
 */
public interface ShoppingCartRepository extends JpaRepository<ShoppingCart, Long> {
    /**
     * 获取购物车
     *
     * @param customer
     * @return List
     */
    List<ShoppingCart> getByCustomer(Customer customer);

    /**
     * 获取购物车
     *
     * @param customer
     * @param merchantStore
     * @return ShoppingCart
     */
    ShoppingCart getByCustomerAndMerchantStore(Customer customer, MerchantStore merchantStore);

}
